﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CarCrash.Application.Drawing.entities;
using CarCrash.Application.Drawing;

namespace CarCrash.Application.Forms
{
    public partial class ObjectDialog : Form
    {

        private Controller controller = Controller.Instance;

        public ObjectDialog()
        {
            InitializeComponent();
        }

        private void ButtonMouseClick(object sender, MouseEventArgs e)
        {
            // определние, что выбрал пользователь
            if (sender == lineButton)
            {
                var newEntity = new Line();
                controller.ChosenEntity = newEntity;
                newEntity.GetForm().ShowDialog(this);
            }
            if (sender == tsButton)
            {
                var newEntity = new TS();
                controller.ChosenEntity = newEntity;
                newEntity.GetForm().ShowDialog(this);
            }
            if (sender == roadButton)
            {
                var newEntity = new RoadLine();
                controller.ChosenEntity = newEntity;
                newEntity.GetForm().ShowDialog(this);
            }
        }

        private void ObjectDialog_Load(object sender, EventArgs e)
        {
        }

    }
}
